<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script type="text/javascript">
        /*for(int i=1;i<arr.length;i++){
        for(int j =0;j<arr.length-i;j++){
            if(arr[j]>arr[j+1]){
                int k = arr[j];
                arr[j] = arr[j+1];
                arr[j+1] = k;
            }
        }
        }
        for(int i=0;i<arr.length;i++){
            System.out.println(arr[i]);
        }
        }
        }
         */
        var v=[5,1,3,2,9]
        for (var d=0; d<v.length-1;d++){
            for (var c=0;c<v.length-d-1;c++){
                if (v[c]>v[c+1]){
                    var a=v[c];
                    v[c]=v[c+1];
                    v[c+1]=a;
                }
            }
        }
        //for (var q=0;q<v.length;q++){
            document.write(v)
            //console.log(v[q])
        //}
    </script>
</body>
</html>